package cn.wegoteam.shop.po;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Discount entity. @author MyEclipse Persistence Tools �����
 */
@Entity
@Table(name = "discount", catalog = "shop")
public class Discount  extends BasePo implements java.io.Serializable {

	// Fields

	private Integer id;
	private String discountName;// ��������
	private String startTime;// ����ʼʱ��
	private String endTime;// �������ʱ��
	private Set<DiscountProduct> discountProducts = new HashSet<DiscountProduct>(
			0);
	private int flag;

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "discount_name", length = 32)
	public String getDiscountName() {
		return this.discountName;
	}

	public void setDiscountName(String discountName) {
		this.discountName = discountName;
	}

	@Column(name = "start_time", length = 32)
	public String getStartTime() {
		return this.startTime;
	}

	public void setStartTime(String startTime) {
		this.startTime = startTime;
	}

	@Column(name = "end_time", length = 32)
	public String getEndTime() {
		return this.endTime;
	}

	public void setEndTime(String endTime) {
		this.endTime = endTime;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "discount")
	public Set<DiscountProduct> getDiscountProducts() {
		return this.discountProducts;
	}

	public void setDiscountProducts(Set<DiscountProduct> discountProducts) {
		this.discountProducts = discountProducts;
	}
    @Column(name="flag",insertable=false,nullable=false)
	public Integer getFlag() {
		return flag;
	}

	public void setFlag(int flag) {
		this.flag = flag;
	}

}